From 5131472984761484c71510d8c588414fa814cc60 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 4 Aug 2014 14:35:15 +0200 Subject: [PATCH] GtkSwitch: Initialize offset when beginning animation handle_x always corresponds to the visible position of the handle, which is where we want to start the animation. Without this, repeated keyboard activation will not always animate. --- gtk/gtkswitch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 28962d2a9b..e9b4fcc1a0 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -188,6 +188,7 @@ gtk_switch_begin_toggle_animation (GtkSwitch *sw) GdkFrameClock *clock = gtk_widget_get_frame_clock (GTK_WIDGET (sw)); priv->start_time = gdk_frame_clock_get_frame_time (clock); priv->end_time = priv->start_time + 1000 * ANIMATION_DURATION; + priv->offset = priv->handle_x; if (priv->tick_id == 0) { priv->tick_id = g_signal_connect (clock, "update", -- 2.30.2